home *** CD-ROM | disk | FTP | other *** search
/ Apple Reference & Presen…rary 5 (Internal Edition) / Apple R&P Lib Internal v5.0.iso / 6-Developer Demos / Developer Demos-Gen. / America Online Demo / Online Files / Online CCL / Online CCL.rsrc / AOcl_502_Datapac < prev    next >
Text File  |  1989-09-25  |  8KB  |  286 lines

  1. !-------------------------------------------------------------------
  2. !   DATAPAC.ALCL
  3. !   By: David Steinberg
  4. !   Phone = (416) 357-2770  (Canada - 1200 baud)
  5. !           (604) 662-7732  (Canada - 2400 baud)
  6. !
  7. !   Date: June 20, 1989
  8. !   Rev: 5.00
  9. !   Changed 9/18/89 by DMC to request Hayes extended commandset
  10. !   Changed 9/19/89 by DMC to report error codes, 
  11. !      and report busy signal as a seperate error
  12. !---------------------------------------------------------------------
  13. !
  14. ! Connect Sequence:
  15. !
  16. -LABEL 0
  17. Revision 5
  18. DsplyMsg Initializing modem.
  19. CanBtn 19               { if cancel button - just exit }
  20. SetTries 0
  21. ChrDelay 2
  22. SerReset ~BAUD 0 8 1
  23. HSReset 0 0 17 19
  24. DsplyPic 1
  25. !
  26. !---------------------------------------------------------------------
  27. !
  28. -LABEL 1                { wake up the modem }
  29. Flush
  30. !                         
  31. MatchStr 1 2 +++        { In case we match dont wait for the full time}
  32. MatchStr 2 2 OK         
  33. MatchStr 3 2 >          { Special case for Avatex 1200 modems}
  34.  
  35. Xmit +++                { Get the modems attention}
  36. Wait 200                { Pause for 2 seconds, minimum gap required}
  37. !
  38. -Label 2
  39. MatchStr 1 3 OK
  40. MatchStr 2 33 NO        { Cant hangup}
  41. MatchStr 3 33 ERROR     { Command error}
  42. MatchStr 4 3 >          { Special case for Avatex 1200 modems}
  43. !
  44. Pause 40                { Allow modem to settle between commands.}
  45. Xmit ATZ\13
  46. !                       { jump to label #3 if we see 'OK' go by }
  47. Wait 200                { wait for 'OK' from modem - fall thru if timeout }
  48. Jump 33                 { Exit stage left...time out error on modem.}
  49. !
  50. !------------------------------------------------------------------
  51. !
  52. -LABEL 3                { just saw 'OK'-Set modem to x1 }
  53. !
  54. MatchStr 1 4 OK
  55. MatchStr 2 4 ERROR        {We don't care what we get for this one}
  56. !
  57. Pause 40                { Allow modem to settle between commands.}
  58. Xmit ATE1Q0X1\13
  59. !
  60. !------------------------------------------------------------------
  61. -LABEL 4                { Now try to dial }
  62. DsplyMsg Dialing ~FONE
  63. !
  64. MatchStr 1 5 CONNECT\13
  65. MatchStr 2 5 CONNECT 300
  66. MatchStr 3 6 CONNECT 1200
  67. MatchStr 4 12 CONNECT 2400    {If there using an MNP modem at dial at say 9600 and connect}
  68. MatchStr 5 12 CONNECT 4800    {at 1200/300 then there screwed for now.}              
  69. MatchStr 6 12 CONNECT 9600
  70. MatchStr 7 33 NO DIAL 
  71. MatchStr 8 27 NO ANSWER
  72. MatchStr 9 33 VOICE
  73. MatchStr 10 33 CARRIER
  74. !
  75. !Changed 9/19/89 by DMC to report busy signals as a seperate error (label 26)
  76. MatchStr 11 26 BUSY
  77. !
  78. MatchStr 12 33 ERROR
  79. !
  80. SetTries 0
  81. CanBtn 18               { if cancel button hit, hangUp then exit }
  82. Pause 30
  83. Xmit AT~MSTR D~TONE~FONE\13
  84. !                       { jump to label #13 if match }
  85. Wait 2400               { wait 30 seconds for CONNECT msg from modem }
  86. !
  87. !
  88. MatchStr 1 7 2400       {We'll couldn't match, But maybe were using an MNP modem.}
  89. MatchStr 2 8 4800       {We could encounter some confusion with number dialed here.} 
  90. MatchStr 3 9 9600       {Dont check for 300,1200 due to this confusion.}
  91. !                       {Plus MNP modems may talk at a higher baud rate then there connect at.}
  92. !
  93. Wait 30
  94. Jump 27                 { else hang up phone & exit  }
  95. !
  96. !----------------------------------------------------------------------
  97. !
  98. -Label 5
  99. SerReset 300 0 8 1
  100. Pause 20
  101. FLUSH
  102. Jump 12
  103. !
  104. !
  105. -Label 6
  106. SerReset 1200 0 8 1
  107. Pause 20
  108. FLUSH
  109. Jump 12
  110. !
  111. !
  112. -Label 7
  113. SerReset 2400 0 8 1
  114. Pause 20
  115. FLUSH
  116. Jump 12
  117. !
  118. -Label 8
  119. SerReset 4800 0 8 1
  120. Pause 20
  121. FLUSH
  122. Jump 12
  123. !
  124. -Label 9
  125. SerReset 9600 0 8 1
  126. Pause 20
  127. FLUSH
  128. Jump 12
  129. !
  130. !
  131. !
  132. !
  133. !----------------------------------------------------------------------
  134. !
  135. -LABEL 12               { Modem just sent 'CONNECT' message }
  136. DsplyPic 2
  137. Pause 60                {  Need some dead time. }
  138. ChrDelay 20      
  139. !  
  140. !      
  141. -LABEL 13               {  Establishing Connection }
  142. MatchStr 1 15 DATAPAC:        
  143. !
  144. Xmit ..\13
  145. Wait 240              {Try to sync up to four times}
  146. IncTries
  147. IfTries 4 32
  148. Jump 13
  149. !
  150. !----------------------------------------------------------------------
  151. !
  152. -LABEL 15           Sending Identifier    
  153. !                         
  154. !
  155. ChrDelay 2
  156. MatchStr 1 16 CALL CONNECTED
  157. MatchStr 2 17 PACKET SIZE:
  158. Xmit ~DPC1\13
  159. !
  160. Wait 960
  161. Jump 32
  162. !
  163. -LABEL 16 
  164. MatchStr 1 17 PACKET SIZE:
  165. Wait 960          {Pause for datapac to finish.}
  166. !
  167. !----------------------------------------------------------------------
  168. !
  169. !----------------------------------------------------------------------
  170. !
  171. -LABEL 17               { System Ready ... All is well }
  172. Pause 60
  173. Exit 0
  174. !
  175. !----------------------------------------------------------------------
  176. !
  177. -Label 18               { User aborted sequence }
  178. Hangup
  179. Exit -111
  180. !
  181. -Label 19               { User aborted sequence...dont need to hang up thou}
  182. Exit -111
  183. !
  184. !----------------------------------------------------------------------
  185. !
  186. -Label 26              {Busy phone}
  187. Talert All phone lines are currently busy. \13Please wait a few minutes and try again.\13
  188. Jump 36
  189. !
  190. !----------------------------------------------------------------------
  191. !
  192. -Label 27              {No Answer}
  193. Talert There is no answer from the access  company (Error # 3).\13Verify the access number and try again.\13
  194. Jump 36
  195. !
  196. !----------------------------------------------------------------------
  197. !
  198. -Label 28              {Noisy line}
  199. Talert There is noise on your phone line (Error # 16).\13Please try again.\13
  200. Jump 36
  201. !
  202. !----------------------------------------------------------------------
  203. !
  204. -Label 29              {acct bad}
  205. Talert Unable to verify account information (Error # 22).\13\13
  206. Jump 36
  207. !
  208. !----------------------------------------------------------------------
  209. !
  210. -Label 30              {disk problem}
  211. Talert There was an error in reading your ~APPL disk (Error # 0).Please try again.\13
  212. Jump 36
  213. !
  214. !----------------------------------------------------------------------
  215. -Label 31              {acct aleady on}
  216. Talert Please wait a few minutes and try again (Error # 23).\13\13
  217. Jump 36
  218. !
  219. !----------------------------------------------------------------------
  220. !
  221. -Label 32              {not_avail}
  222. Talert ~APPL is not available at the moment (Error # 20).\13Please wait a few minutes and try again.\13\13
  223. Jump 36
  224. !
  225. !----------------------------------------------------------------------
  226. !
  227. -Label 33              {generic}
  228. Talert Unable to initialize modem (Error # 1). Please take the following steps:\13\13 1) Turn your modem off, then back on.\13 2) Verify the access number.\13 3) Make sure that your modem and phone line are connected  correctly.\13 4) Try again.
  229. Jump 36
  230. !
  231. !----------------------------------------------------------------------
  232. !
  233. -Label 34               {db_error}
  234. Talert There is a bad ~APPL file on your disk (Error # 0).\13\13
  235. Jump 36
  236. !
  237. !----------------------------------------------------------------------
  238. !
  239. -Label 35
  240. Exit -1
  241. !
  242. !----------------------------------------------------------------------
  243. !
  244. -Label 36
  245. Alert 35 \13If the problem persists, call ~APPL customer service at ~ACUS.
  246. Exit -1
  247. !
  248. !----------------------------------------------------------------------
  249. !
  250. *-Label 0                {Hangup Sequence}
  251. *CanBtn 2
  252. *ChrDelay 2
  253. !
  254. *Flush
  255. !
  256. *MatchStr 1 1 OK         { Dont look for an echo first time, maybe a}
  257. *MatchStr 2 1 NO         { false echo.  Any type of match is good}
  258. *MatchStr 3 1 >          { Special case for Avatex 1200 modems}
  259. !
  260. *Xmit +++                {Try and get the modems attention}
  261. *Wait 210
  262. !
  263. *MatchStr 1 1 OK
  264. *MatchStr 2 2 CARRIER {Any type of match is good}
  265. *MatchStr 3 1 +++
  266. *MatchStr 4 1 >          { Special case for Avatex 1200 modems}
  267. !
  268. *Xmit +++                {Double our odds}
  269. *Wait 210
  270. !
  271. *-Label 1
  272. *MatchStr 1 2 ERROR
  273. *MatchStr 2 2 OK
  274. *MatchStr 3 2 CARRIER
  275. *MatchStr 4 2 >          { Special case for Avatex 1200 modems}
  276. !
  277. *Pause 40
  278. *Xmit AT H\13
  279. *Wait 300
  280. !
  281. *-Label 2
  282. *Exit 0
  283. !
  284. ###
  285.